﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StoredProcedureGenerator
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = "Data Source=IPDS2006-ML;Initial Catalog=TestDB;Integrated Security=True";

            MSSQL_GenerateStoredProceduresClass ms = new MSSQL_GenerateStoredProceduresClass(connectionString);
            ms.InsertSpTemplateFile = @"..\..\Templates\InsertSpTemplate.spt";
            ms.UpdateSpTemplateFile = @"..\..\Templates\UpdateSpTemplate.spt";
            ms.DeleteSpTemplateFile = @"..\..\Templates\DeleteSpTemplate.spt";
            ms.OutputFilesPath = @"storedProcedures\";


            try
            {
                //generate SPs
                ms.GenerateStoredProcedures();
            }
            catch (Exception ex)
            {
                Console.WriteLine("\nERROR: " + ex.Message);
            }
            //stop :)
            Console.Read();
        }

    }

}
